package exception;

import enums.ResponseCode;

/**
 * 名称BaseException
 * 描述:基本异常类
 *
 * @version 1.0
 * @author:LYZ
 * @datatime:2024-10-23 14:34
 */
public class BaseException extends RuntimeException{
	private static final long serialVersionUID = -5658789202563433456L;

	public BaseException() {
	}

	protected ResponseCode code;

	public BaseException(String message, ResponseCode code) {
		super(message);
		this.code = code;
	}

	public BaseException(String message, Throwable cause, ResponseCode code) {
		super(message, cause);
		this.code = code;
	}

	public BaseException(ResponseCode code, Throwable cause) {
		super(cause);
		this.code = code;
	}

	public BaseException(String message, Throwable cause,
						 boolean enableSuppression, boolean writableStackTrace, ResponseCode code) {
		super(message, cause, enableSuppression, writableStackTrace);
		this.code = code;
	}

	public ResponseCode getCode() {
		return code;
	}
}
